home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form Form2
- BorderStyle = 3 'Fixed Double
- Caption = "Form2"
- ClientHeight = 6360
- ClientLeft = 795
- ClientTop = 1950
- ClientWidth = 9630
- Height = 6765
- Icon = FLUDFILL.FRX:0000
- Left = 735
- LinkTopic = "Form2"
- Picture = FLUDFILL.FRX:0302
- ScaleHeight = 424
- ScaleMode = 3 'Pixel
- ScaleWidth = 642
- Top = 1605
- Width = 9750
- Begin CommandButton Command2
- Caption = "AutoRedraw = FALSE"
- Height = 372
- Left = 1440
- TabIndex = 2
- Top = 600
- Width = 2652
- End
- Begin PictureBox Picture2
- BackColor = &H00FFFFFF&
- ForeColor = &H00FFFFFF&
- Height = 132
- Left = 120
- ScaleHeight = 105
- ScaleWidth = 1185
- TabIndex = 1
- Top = 720
- Width = 1212
- End
- Begin PictureBox Picture1
- AutoSize = -1 'True
- BorderStyle = 0 'None
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Courier"
- FontSize = 9.75
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 525
- Left = 1440
- Picture = FLUDFILL.FRX:3181C
- ScaleHeight = 35
- ScaleMode = 3 'Pixel
- ScaleWidth = 428
- TabIndex = 0
- Top = 120
- Width = 6420
- End
- Begin Label Label1
- Caption = "Choose a color..."
- Height = 492
- Left = 120
- TabIndex = 3
- Top = 120
- Width = 1212
- End
- Sub Command2_Click ()
- form2.AutoRedraw = Not form2.AutoRedraw
- If form2.AutoRedraw Then
- Command2.Caption = "AutoRedraw = TRUE"
- Command2.Caption = "AutoRedraw = FALSE"
- End If
- End Sub
- Sub Form_Load ()
- xcolor = RGB(255, 255, 255)
- End Sub
- Sub Form_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
- FillStyle = 0 ' Set FillStyle to solid.
- FillColor = xcolor ' Set FillColor.
- FloodFill hDC, x, y, forecolor ' Call Windows API to fill.
- Dim h As Long
- h = getpixel(hDC, 0, 0)
- If h = RGB(255, 255, 255) Then 'force background to remain white
- Else
- FillColor = RGB(255, 255, 255)
- FloodFill hDC, 8, 15, forecolor
- End If
- If form2.AutoRedraw = True Then
- form2.Refresh 'shows changes made to the picture when autoredraw is true.
- End If 'changes are temporary otherwise, or not visible without this statement.
- End Sub
- Sub Picture1_MouseDown (Button As Integer, Shift As Integer, x As Single, y As Single)
- Dim wcolor As Long
- wcolor = getpixel(Picture1.hDC, x, y)
- If wcolor < 1 Then
- Beep
- Else
- xcolor = wcolor
- End If
- Picture2.BackColor = xcolor
- End Sub
-